package com.josephxu.tank.strategy;

/**
 * @Author: Joseph Xu
 * @Date: 2022/1/25 21:08
 */
public class Cat implements Comparable<Cat>{

    private int weight;

    private int height;

    public Cat() {
    }

    public Cat(int weight) {
        this.weight = weight;
    }

    public Cat(int weight, int height) {
        this.weight = weight;
        this.height = height;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Cat{" +
                "weight=" + weight +
                ", height=" + height +
                '}';
    }

    @Override
    public int compareTo(Cat o) {
        if (this.weight > o.getWeight()){
            return 1;
        }else if (this.weight < o.getWeight()){
            return -1;
        }else return 0;
    }
}
